\section{Display Management}\label{sec:displaymanagement}
\fancyfoot[C]{Display Management}
The CMS provides a system for uniting content and data at runtime. Once a user makes a request for content from the CMS, the CMS manages the retrieval of seperate content and display entities, then unites them before presenting them to the user. The intended result is that template webpages are designed to be modular and easy to modify, so that more user effort is expended on actual content creation. Additionally, this system will provide a unified display method for CMS content. Figure \ref{fig:DisplayCMSConnection} illustrates the procedure flow executed to create CMS-served content.
%todo: diagram showing "blocks" of busn-layer or data-layer calls inside a Display file?
\begin{figure}[!ht]
  \centering
    \includegraphics[height=4in]{DisplaySequenceDiagram.eps}
  \caption{A diagram outlining the steps involved in uniting content in a Display.}
\label{fig:DisplayCMSConnection}
\end{figure}
\begin{enumerate}
\item The CMS acquires the appliciable Display files from the local filesystem.
\item The CMS executes any business-layer and Data Layer method calls found in the aforementioned Display files and specified in the request.
\item The CMS unites output from the aforementioned method calls to the template HTML files.
\item The CMS returns the united Display and data as a Web Page to the user.
\end{enumerate}
In this way the system fufills SRS Requirements 3.4.1, regarding the use of Displays as visual wrappers for Content.
\subsection{Data Representation of Displays}
The Displays are stored in the filesystem as .ASPX (ASP.NET) files with special placeholders, along with conventional HTML and CSS. This collection of files provides ``code-behind'', in that webpage interactions and web page code reference and execute CMS/Plugin functionality. Figures \ref{code:exampleaspx1} and \ref{code:exampleaspx2} are ASCX and C\# code snippets that illustrate this code-behind concept.\\
Because the HTML/CSS components of Displays are a collection web markup files, they may be edited and modified in keeping with SRS Requirements 3.4.2, 3.4.3, and 3.4.4, regarding editing of Displays via CMS-hosted and user-preferred applications.
\begin{figure}[!ht]
	\centering
		\begin{verbatim}
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RadioButtonDisplayCode.ascx.cs" Inherits="RadioButtonDisplayCode"
Debug="true" %>
<asp:Literal ID="Literal_RowBegin" runat="server"></asp:Literal>
 
<asp:Panel ID="thePanel" runat="server">
</asp:Panel>
 
<asp:Literal ID="Literal_RowEnd" runat="server"></asp:Literal>
		\end{verbatim}
	\caption{Code snippet demonstrating the CMSLabel functionality as a placeholder for Content.}
	\label{code:exampleaspx1}
\end{figure}

\begin{figure}[!ht]
	\centering
		\begin{verbatim}
public class RadioButtonDisplayCode
{
	public void DataBind()
	{
		string rowbegin = "<tr class=\"itemtemplate\"><td align=\"left\">";
		string rowend = "</td></tr>";
		string rowheader = "Radio Buttons Example";

		if (alternate)
		{
			rowbegin = "<tr class=\"alternatetemplate\"><td align=\"left\">";
		}
		Literal_RowBegin.Text = rowbegin + rowheader;
		Literal_RowEnd.Text = rowend;

		for (int i = 1; i < columns.Count; i++ )
		{
			Label radiobegin = new Label();
			
			radiobegin.Text = "</td><td align=\"center\">";
			RadioButton newButton = new RadioButton();
			newButton.GroupName = rowheader;
			newButton.Text = "Button 1";

			thePanel.Controls.Add(radiobegin);
			thePanel.Controls.Add(newButton);
			buttons.Add(newButton);

			theRadioButtonList.Items.Add("");
		}
	}

	private List<RadioButton> buttons = new List<RadioButton>();
}
		\end{verbatim}
  \caption{Code-behind for a Display with a few controls.}
\label{code:exampleaspx2}
\end{figure}

